package com.beimi.game.player;

import com.beimi.game.BaseGame;
import com.corundumstudio.socketio.SocketIOClient;

public class GamePlayer {
	
	private BaseGame game;
	
	private long userId;
	
	private PlayerCardModule cardModule;
	
	private SocketIOClient client;
	
	private int seat;
	
	private boolean canChuPai;
	
	private String name;
	
	public GamePlayer()
	{
		cardModule = new PlayerCardModule();
	}
	
	public PlayerCardModule getCardModule() {
		return cardModule;
	}

	public SocketIOClient getClient() {
		return client;
	}

	public void setClient(SocketIOClient client) {
		this.client = client;
	}

	public long getUserId() {
		return userId;
	}

	public void setUserId(long userId) {
		this.userId = userId;
	}

	public void sendMessage(String name, Object data) {
		if (client != null) {
			client.sendEvent(name, data);
		}
	}

	public BaseGame getGame() {
		return game;
	}

	public int getSeat() {
		return seat;
	}

	public void setSeat(int seat) {
		this.seat = seat;
	}

	public boolean isCanChuPai() {
		return canChuPai;
	}

	public void setCanChuPai(boolean canChuPai) {
		this.canChuPai = canChuPai;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void randomChuPai() {
		getCardModule().randomPop();
	}

	public void init() {
		
	}
}
